<template> 
    <div id="img" v-if="showpage">
        <div class="wrap">
              <div class="wrap-box">
                  <div class="box-content">
                      <div class="sign">
                          <h2 class="title">没有账号吗？</h2>
                          <p class="desc">点击这里注册一个账号</p>
                          <button type="button" class="get-register">注册</button>
                      </div>
                      <div class="login">
                          <h2 class="title">已经有账号了吗？</h2>
                          <p class="desc">点击这里登录</p>
                          <button type="button" class="get-login">登录</button>
                      </div>
                  </div>
          
                  <div class="manager-box">
                      <div class="login-part fadein" >
                          <h3>登录</h3>
                          <div class="input-box">
                              <input type="text" placeholder="用户名" v-model="user.username">
                              <i class="iconfont icon-wo"></i>
                          </div>
                          <div class="input-box">
                              <input type="password" placeholder="密码" v-model="user.password">
                              <i class="iconfont icon-mima"></i>
                          </div>
                          <div class="buttons clearfix">
                              <a href="javascript:;">忘记密码？</a>
                              <a >
                                  <RouterLink to="/main">
                                    <button type="button" class="btn-login fr" >
                                        登录
                                    </button>
                                </RouterLink>
                              </a>
                              
                          </div>
                      </div>
                      <div class="sign-part fadeout">
                          <h3>注册</h3>
                          <div class="input-box">
                              <input type="text" placeholder="用户名" v-model="registr.username">
                              <i class="iconfont icon-wo"></i>
                          </div>
                          <div class="input-box">
                              <input type="password" placeholder="密码" v-model="registr.password">
                              <i class="iconfont icon-mima"></i>
                          </div>
                          <div class="input-box">
                              <input type="password" placeholder="确认密码" v-model="registr.conPassword">
                              <i class="iconfont icon-mima"></i>
                          </div>
                          <div class="buttons clearfix">
                              <button type="button" class="btn-register fr" @click="regi">注册</button>
                          </div>
                      </div>
                  </div>
              </div>
              <div align="center">
              
              </div>
              <div id="img">
                  <img src="../login/img/1.png" alt="这是一张图片" style="width: 200px; height: 200px">
              </div>
          </div>
     </div>
</template>
      
<script>
    import $ from 'jquery'
     import { RouterLink } from 'vue-router';
     $(function(){
         $(".get-login").click(function () {
              $(".manager-box").removeClass("left").addClass("right");
              $(".sign-part").addClass("fadein").removeClass("fadeout");
              $(".login-part").addClass("fadeout").removeClass("fadein");
          });
      
          $(".get-register").click(function () {
              $(".manager-box").removeClass("right").addClass("left");
              $(".sign-part").addClass("fadeout").removeClass("fadein");
              $(".login-part").addClass("fadein").removeClass("fadeout");
          });
     })
    
    export default{
        name:'login',
        data(){
            return{
                user:{},
                registr:{},
                showpage:true,
                 furnitureList:[],
                }
        },
         methods:{
            regi(){
                if(this.registr.password==this.registr.conPassword){
                this.user.username = this.registr.username
                this.user.password = this.registr.password
                this.registr={}
                $.post(`${import.meta.env.VITE_REQUEST_URL}/register`,this.user,(result)=>{
                    if(result.resultType=='success'){
                        this.user={}
                        window.alert('注册成功，请返回登录')
                    }
                })
                }
            },
            login(){
                $.post(`${import.meta.env.VITE_REQUEST_URL}/login`,this.user,(result)=>{
                if(this.user.username==null || this.user.password==null){
                    window.alert('请输入账号和密码')
                }
                else if(result.resultType=='success'){
                window.alert('登录成功！！！')
                this.$router.push({                
                    path:"/v",
                    query:{
                        uname : JSON.stringify(this.user.username),
                        pwd:JSON.stringify(this.user.password)
                        }                             
                    }),
                     this.showpage=false
                     }else{
                         window.alert('用户名不存在或密码错误')
                         this.user={}
                     }
                   })
                 },
                
            },
            
              
                 
            }
      
</script>

<style scoped>
      
.app-container {
  padding-bottom: 300px;
  width: 800px;
  margin: 0 auto;
}
@media screen and (max-width: 800px) {
  .app-container {
    width: 600px;
  }
}
.app-container .banner-box {
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 10px;
}
.app-container .banner-box img {
  width: 100%;
}
.app-container .nav-box {
  background: #ddedec;
  height: 60px;
  border-radius: 10px;
  padding-left: 20px;
  display: flex;
  align-items: center;
}
.app-container .nav-box .my-nav {
  display: inline-block;
  background: #5fca71;
  border-radius: 5px;
  width: 90px;
  height: 35px;
  color: white;
  text-align: center;
  line-height: 35px;
  margin-right: 10px;
}

.breadcrumb {
  font-size: 16px;
  color: gray;
}
.table {
  width: 100%;
  text-align: left;
  border-radius: 2px 2px 0 0;
  border-collapse: separate;
  border-spacing: 0;
}
.th {
  color: rgba(0, 0, 0, 0.85);
  font-weight: 500;
  text-align: left;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.3s ease;
}
.th.num-th {
  flex: 1.5;
}
.th {
  text-align: center;
}
.th:nth-child(4),
.th:nth-child(5),
.th:nth-child(6),
.th:nth-child(7) {
  text-align: center;
}
.th.th-pic {
  flex: 1.3;
}
.th:nth-child(6) {
  flex: 1.3;
}

.th,
.td {
  position: relative;
  padding: 16px 16px;
  overflow-wrap: break-word;
  flex: 1;
}
.pick-td {
  font-size: 14px;
}
.main,
.empty {
  border: 1px solid #f0f0f0;
  margin-top: 10px;
}
.tr {
  display: flex;
  cursor: pointer;
  border-bottom: 1px solid #ebeef5;
}
.tr.active {
  background-color: #f5f7fa;
}
.td {
  display: flex;
  justify-content: center;
  align-items: center;
}

.table img {
  width: 100px;
  height: 100px;
}

button >d1{
  outline: 0;
  box-shadow: none;
  color: #fff;
  background:blue;
  border-color: blue;
  color: #fff;
  background: blue;
  border-color: blue;
  line-height: 1.5715;
  position: relative;
  display: inline-block;
  font-weight: 400;
  white-space: nowrap;
  text-align: center;
  background-image: none;
  border: 1px solid transparent;
  box-shadow: 0 2px 0 rgb(0 0 0 / 2%);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  touch-action: manipulation;
  height: 32px;
  padding: 4px 15px;
  font-size: 14px;
  border-radius: 2px;
}
button {
  outline: 0;
  box-shadow: none;
  color: #fff;
  background:red;
  border-color: red;
  color: #fff;
  background: red;
  border-color: red;
  line-height: 1.5715;
  position: relative;
  display: inline-block;
  font-weight: 400;
  white-space: nowrap;
  text-align: center;
  background-image: none;
  border: 1px solid transparent;
  box-shadow: 0 2px 0 rgb(0 0 0 / 2%);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  touch-action: manipulation;
  height: 32px;
  padding: 4px 15px;
  font-size: 14px;
  border-radius: 2px;
}
button.pay {
  background-color: #3f85ed;
  margin-left: 20px;
}

.bottom {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 20px;
  border: 1px solid #f0f0f0;
  border-top: none;
  padding-left: 20px;
}
.right-box {
  display: flex;
  align-items: center;
}
.check-all {
  cursor: pointer;
}
.price {
  color: hotpink;
  font-size: 30px;
  font-weight: 700;
}
.price-box {
  display: flex;
  align-items: center;
}
.empty {
  padding: 20px;
  text-align: center;
  font-size: 30px;
  color: #909399;
}
.my-input-number {
  display: flex;
}
.my-input-number button {
  height: 40px;
  color: #333;
  border: 1px solid #dcdfe6;
  background-color: #f5f7fa;
}
.my-input-number button:disabled {
  cursor: not-allowed!important;
}
.my-input-number .my-input__inner {
  height: 40px;
  width: 50px;
  padding: 0;
  border: none;
  border-top: 1px solid #dcdfe6;
  border-bottom: 1px solid #dcdfe6;
}

.my-input-number {
  position: relative;
  display: inline-block;
  width: 140px;
  line-height: 38px;
}
.my-input-number span {
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}
.my-input-number .my-input {
  display: block;
  position: relative;
  font-size: 14px;
  width: 100%;
}
.my-input-number .my-input__inner {
  -webkit-appearance: none;
  background-color: #fff;
  background-image: none;
  border-radius: 4px;
  border: 1px solid #dcdfe6;
  box-sizing: border-box;
  color: #606266;
  display: inline-block;
  font-size: inherit;
  height: 40px;
  line-height: 40px;
  outline: none;
  padding: 0 15px;
  transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
  width: 100%;
  padding-left: 50px;
  padding-right: 50px;
  text-align: center;
}
.my-input-number .my-input-number__decrease,
.my-input-number .my-input-number__increase {
  position: absolute;
  z-index: 1;
  top: 1px;
  width: 40px;
  height: auto;
  text-align: center;
  background: #f5f7fa;
  color: #606266;
  cursor: pointer;
  font-size: 13px;
}
.my-input-number .my-input-number__decrease {
  left: 1px;
  border-radius: 4px 0 0 4px;
  border-right: 1px solid #dcdfe6;
}
.my-input-number .my-input-number__increase {
  right: 1px;
  border-radius: 0 4px 4px 0;
  border-left: 1px solid #dcdfe6;
}
.my-input-number .my-input-number__decrease.is-disabled,
.my-input-number .my-input-number__increase.is-disabled {
  color: #c0c4cc;
  cursor: not-allowed;
}
#img{
  background-image: url('../login/img/1.jpg');
  font-size: 14px;
  color: #666;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  width: 100%;
  height: 100%;
  position: fixed;
  border-style: 100% 100%;
}
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td,button,article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section {
    margin: 0;
    padding: 0;
}
body,button,input,select,textarea {
    font-family: 'Microsoft YaHei',arial,SimSun,sans-serif,tahoma;
}
body{
    font-size: 14px;
    color: #666;
}
input,select,textarea {
    font-size: 100%;
}
table {
    border-collapse: collapse;
    border-spacing: 0;
}
textarea,input,button,a {
    outline: none;
}
button {
    cursor: pointer;
}
textarea {
    resize: none;
}
fieldset,img { 
    border: 0;
}
address,cite,code,dfn,em,i,th,var {
    font-style: normal;
    font-weight: normal;
}
ol,ul {
    list-style: none;
}
caption,th {
    text-align: left;
}
h1,h2,h3,h4,h5,h6 {
    font-size: 100%;
    font-weight: normal;
}
sub, sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}
sup {
    top: -0.5em;
}
sub {
    bottom: -0.25em;
}
a {
    text-decoration: none;
}
.clearfix:before ,.clearfix:after {
    content: "";
    display: table;
}
.clearfix:after {
    clear: both;
    overflow: hidden;
}

.fl {
    float: left;
}
.fr {
    float: right;
}
.hidenone {
    display: none;
}
.hide {
    visibility: hidden;
}
.mt10 {
    margin-top: 10px;
}
.mt20 {
    margin-top: 20px;
}
.ml10 {
    margin-left: 10px;
}
.mr10 {
    margin-right: 10px;
}
.pt10 {
    padding-top: 10px;
}
.pt20 {
    padding-top: 20px;
}
.pl10 {
    padding-left: 10px;
}
.pr10 {
    padding-right: 10px;
}
.tc {
    text-align: center;
}
.vm {
    display: inline-block;
    vertical-align: middle;
}

*,
*:after,
*:before {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

.wrap {
    position: relative;
    height: 100%;
    background-size: cover;
    
}

.wrap:after {
    content: "";
    width: 100%;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    background: inherit;
    filter: blur(3px);
    z-index: 1;
}

.wrap-box {
    position: absolute;
    width: 840px;
    height: 320px;
    background: rgba(0, 0, 0, .6);
    z-index: 2;
    box-shadow: 0 0 10px 1px rgba(169, 169, 169, .2);
    border-radius: 30px;
    top: calc(50% - 160px);
    left: calc(50% - 410px);
    /* margin-left: 70px;
    margin-bottom:100000px */
}

.box-content {
    display: inline-table;
    width: 100%;
    height: 100%;
}

.box-content .sign,
.box-content .login {
    display: table-cell;
    width: 50%;
    vertical-align: middle;
    line-height: 36px;
}

.sign {
    padding-left: 70px;
}

.login {
    padding-left: 100px;
}

.box-content .title {
    color: #e8e8e8;
    font-size: 22px;
    letter-spacing: 1px;
}

.box-content .desc {
    color: #d3d3d3;
    font-size: 14px;
}

.box-content button {
    border-radius: 3px;
    border: solid 1px #d3d3d3;
    background-color: transparent;
    color: #d3d3d3;
    width: 124px;
    height: 38px;
    margin: 15px auto 0;
    font-size: 16px;
    transition: all .2s;
}

.box-content button:hover {
    border-color: #fff;
    color: #fff;
}

.manager-box {
    position: absolute;
    height: 380px;
    width: 400px;
    left: 50px;
    top: -30px;
    transition: all .8s linear;
    background: #fff;
    padding: 0 40px;
    border-radius: 30px;
    box-shadow: 0 0 15px 4px rgba(0, 0, 0, .1);
    display: inline-table;
    
}

.manager-box>* {
    display: table-cell;
    vertical-align: middle;
}

.manager-box>*.fadein {
    display: none;
    animation: hide 1s 1 forwards;
}

.manager-box>*.fadeout {
    display: table-cell;
    animation: show 1s 1 forwards;
}

@keyframes hide {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

@keyframes show {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.manager-box.right {
    animation: toRight 1s 1 forwards;
}

@keyframes toRight {
    0% {
        left: 50px;
    }

    45% {
        left: 450px;
    }

    80% {
        left: 380px;
    }

    100% {
        left: 390px;
    }
}

.manager-box.left {
    animation: toLeft 1s 1 forwards;
}

@keyframes toLeft {
    0% {
        left: 390px;
    }

    45% {
        left: 10px;
    }

    80% {
        left: 60px;
    }

    100% {
        left: 50px;
    }
}

.manager-box h3 {
    color: #c17bf7;
    font-size: 22px;
    margin-bottom: 30px;
}

.input-box {
    position: relative;
    margin: 30px 0;
}

.input-box i {
    position: absolute;
    width: 0;
    bottom: 7px;
    background-color: #7bf7ca;
    transition: all .36s;
    right: 20px;
    color: #ccc;
}

.input-box input {
    display: block;
    border: 0;
    border-bottom: solid 1px #ddd;
    line-height: 34px;
    width: 100%;
    transition: all .2s;
    font-size: 16px;
    padding-right: 30px;
}

.input-box input::placeholder {
    color: #ccc;
    font-size: 14px;
}

.input-box input:focus + i {
    color: #8a7bf7;
}

.input-box i:after {
    content: '';
    position: absolute;
    right: -20px;
    width: 0;
    height: 1px;
    background-color: #f78c7b;
    transition: all .4s;
    bottom: -7px;
}

.input-box input:focus + i:after {
    width: 320px;
}

.manager-box button {
    border-radius: 0;
    width: 124px;
    height: 38px;
    color: #fff;
    background-color: #f78c7b;
    border: 0;
    font-size: 16px;
}

.manager-box button:hover {
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0) 30%, #eeeeff 60%, #eeeeff 65%, rgba(0, 0, 0, 0) 70%) 53% 105% / 10px 10px,
    radial-gradient(circle at center, rgba(0, 0, 0, 0) 30%, #eeeeff 60%, #eeeeff 65%, rgba(0, 0, 0, 0) 70%) 16% 132% / 12px  12px,
    radial-gradient(circle at center, rgba(0, 0, 0, 0) 30%, #eeeeff 60%, #eeeeff 65%, rgba(0, 0, 0, 0) 70%) 56% 94% / 8px 8px,
    radial-gradient(circle at center, rgba(0, 0, 0, 0) 30%, #eeeeff 60%, #eeeeff 65%, rgba(0, 0, 0, 0) 70%) 42% 126% / 14px 14px,
    radial-gradient(circle at center, rgba(0, 0, 0, 0) 30%, #eeeeff 60%, #eeeeff 65%, rgba(0, 0, 0, 0) 70%) 11% 119% / 11px 11px,
    radial-gradient(circle at center, rgba(0, 0, 0, 0) 30%, #eeeeff 60%, #eeeeff 65%, rgba(0, 0, 0, 0) 70%) 69% 143% / 9px 9px,
    radial-gradient(circle at center, rgba(0, 0, 0, 0) 30%, #eeeeff 60%, #eeeeff 65%, rgba(0, 0, 0, 0) 70%) 107% 141% / 6px 6px,
    radial-gradient(circle at center, rgba(0, 0, 0, 0) 30%, #eeeeff 60%, #eeeeff 65%, rgba(0, 0, 0, 0) 70%) 51% 132% / 10px 10px,
    radial-gradient(circle at center, rgba(0, 0, 0, 0) 30%, #eeeeff 60%, #eeeeff 65%, rgba(0, 0, 0, 0) 70%) 20% 121% / 15px 15px,
    radial-gradient(circle at center, rgba(0, 0, 0, 0) 30%, #eeeeff 60%, #eeeeff 65%, rgba(0, 0, 0, 0) 70%) 68% 121% / 6px 6px,
    radial-gradient(circle at center, rgba(0, 0, 0, 0) 30%, #eeeeff 60%, #eeeeff 65%, rgba(0, 0, 0, 0) 70%) 22% 127% / 11px 11px;
    background-color: #e27b75;
    background-repeat: no-repeat;
    animation: bubbles .7s forwards ease-out;
}

@keyframes bubbles {
    100% {
        background-position: 48% -266%, 17% -396%, 58% -137%, 33% -360%, 21% -368%, 77% -137%, 114% -391%, 43% -2%, -1% -41%, 60% -207%, 27% -149%;
        box-shadow: inset 0 -60px 0 #c56868;
    }
}
#font{
    color: blue;
}
#id{
    width: 10px;
    height: 10px;
}
.manager-box .buttons {
    margin-top: 40px;
    line-height: 39px;
}

.manager-box .buttons a {
    position: relative;
    color: #999;
}

.manager-box .buttons a:hover {
    color: #f77bda;
}

</style>
      